package slowka;

import java.beans.*;

public class Word extends XMLSerializable {

    /** Creates word
     * @param W word to represent
     * @param L language of word
     */
    public Word(String W, String L) {
        word = W;
        language = L;
    }

    public String getWord() {
        return word;
    }
    public String getLanguage() {
        return language;
    }

    public boolean isIncomplete() {
        return word == null ||
                language == null ||
                word.length() == 0 ||
                language.length()== 0;
    }

    private String word, language;

    public static void extractPersistanceDelegates(XMLEncoder e) {
        e.setPersistenceDelegate(Word.class, new DefaultPersistenceDelegate(new String[] {"word", "language"}));
    }
}